package com.helmlabs.grouper.accounts.dao;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import com.helmlabs.grouper.accounts.model.Role;

public interface RoleDao {
	
	public Role save(Role role);
	public Role get(Long id);

	/**
	 * Associate an object with a specific role
	 * @param roleType
	 * @param objectId
	 * @param roleId
	 * @return
	 */
	public boolean activateObjectInRole(String roleType, Long objectId, Long roleId);
	
	/**
	 * Disassociate an object with a specific role
	 * @param roleType
	 * @param objectId
	 * @param roleId
	 * @return
	 */
	public boolean deactivateObjectInRole(String roleType, Long objectId, Long roleId);
	public boolean isObjectInRole(String roleType, Long objectId, Long roleId);

	public List<Role> getActiveRolesForObject(String roleType, Long objectId);
	
	@Deprecated
	public List<Role> getAllActiveByUserId(Long userid);
	public List<Role> getAllRolesByTypeAndParent(String type, Long parentid);	
	public boolean isObjectInRoleRecursive(String roleType, Long objectId, Long roleId);

}
